document.addEventListener('plusready',function(){
	var uid = plus.storage.getItem('uid');
	showWating();
	$.ajax({
		type:"get",
		url:apiRoot+"?m=home&c=article&a=myNews&uid="+uid,
//		dataType :'json',
		success :function(data){
//			console.log(JSON.stringify(data));
			if(data){
				plus.storage.setItem('newslit',data);
				var newlis = $.parseJSON(data);
				var list = '';
				$.each(newlis, function(k,v) {
//					console.log(JSON.stringify(v));
					list += '<div class="new-list" data-id="'+v.id+'">'+
								'<div class="mui-text-center">'+
									'<span>'+v.addtime+'</span>'+
								'</div>'+
								'<div class="mui-card mui-table-view-cell mui-table-view">'+
									'<li class="mui-ellipsis-2">'+v.title+'</li>'+
									'<li class="mui-h6">'+v.addtime+'</li>';
							if(v.litpic){
								list += '<li><img src="'+webRoot+v.litpic+'"/></li>';
							}
							list += '<li class="mui-h6">'+(v.description).substring(0,10)+'... ...</li>'+
									'<li class="font-14">查看全文</li>'+
								'</div>'+
							'</div>';
				});
				$('.newlist').html(list);
				plus.nativeUI.closeWaiting();
				$('.new-list').on('click',function(){
					goNewPage('me-new.html', {aid:$(this).attr('data-id')});
				})
			}
			
		},
		error :function(e){
			var newsl = plus.storage.getItem('newslit');
			if(newsl){
				var newlis = $.parseJSON(newsl);
				var list = '';
				$.each(newlis, function(k,v) {
					console.log(JSON.stringify(v));
					list += '<div class="new-list" data-id="'+v.id+'">'+
								'<div class="mui-text-center">'+
									'<span>'+v.addtime+'</span>'+
								'</div>'+
								'<div class="mui-card mui-table-view-cell mui-table-view">'+
									'<li class="mui-ellipsis-2">'+v.body+'</li>'+
									'<li class="mui-h6">'+v.addtime+'</li>'+
									'<li><img src="'+webRoot+v.litpic+'"/></li>'+
									'<li class="mui-h6">'+(v.description).substring(0,10)+'</li>'+
									'<li class="font-14">查看全文</li>'+
								'</div>'+
							'</div>';
				});
				$('.newlist').html(list);
				plus.nativeUI.closeWaiting();
				$('.new-list').on('click',function(){
					goNewPage('me-new.html', {aid:$(this).attr('data-id')});
				})
			}
			console.log(JSON.stringify(e));
			errortoast();
		}
	});
},false)